<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #divs{
        width: 200px;
        height: 200px;
        background-color: blueviolet;
    }
</style>
<body>
    <div id="divs"></div>
    <script>
     let div=document.querySelector("#divs");
      //自己写好事件
      div.addEventListener("click",()=>{
          console.log("div事件");
      })
     setInterval(() => {
         div.click(); //会自动调用点击事件
     }, 1000);
    </script>
</body>
</html>